Sage Ent. Mgmt.: Find examples of using SOAP web services with XML and JSON formats in the Sage KB

2 minute read time.

Sage Enterprise Management provides the convenience of being able to use web services which can provide real-time interfaces between the ERP and external applications. We can expose custom or existing Enterprise Management objects and functions as web services.

One method that can be used with web services is Simple Object Access Protocol (SOAP).

As of Product Update 9, web services is part of the Syracuse platform. Did you know there are syntax examples in the knowledgebase for how to consume these SOAP web services. You can go tot he knowledgebase and search for the article IDs listed below.

Prerequisites:

  • You must have a value other than 0 for Number of Web service child processes in the hosts entity
  • You must configure your pool in Classic SOAP pools configuration (soapClassicPools)
  • You must have published your web service within Development
    • Note: By default, only the SOH, BPC, and ITM objects are optimized for web services

Note: There is a web service tester in Administration, Administration, Web Services, Classic SOAP Web services (soapGenerics), however you can test web services with a variety of 3rd party products including SOAPUI and Postman. For these products, you may need to use a CDATA tag within the objectXML.

Web services can be consumed using XML or JSON in some cases.

For example in KB ID 80551 there is an example for using the BPC object to save/create a record.

XML format

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wss="http://www.adonix.com/WSS">
   <soapenv:Header/>
   <soapenv:Body>
      <wss:save soapenv:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/">
         <callContext xsi:type="wss:CAdxCallContext">
            <codeLang xsi:type="xsd:string">ENG</codeLang>
            <poolAlias xsi:type="xsd:string">V11P0</poolAlias>
            <poolId xsi:type="xsd:string"></poolId>
            <requestConfig xsi:type="xsd:string"></requestConfig>
         </callContext>
         <publicName xsi:type="xsd:string">BPC</publicName>
         <objectXml xsi:type="xsd:string">
<![CDATA[<PARAM>
 <GRP ID="BPC0_1" >
 <FLD NAME="BCGCOD" TYPE="Char" >US</FLD>
 <FLD NAME="BPCNUM" TYPE="Char" >NA323</FLD>
 </GRP>
 <GRP ID="BPRC_1">
  <FLD NAME="BPRNAM" TYPE="Char">New</FLD>
 </GRP>
 <TAB DIM="30" ID="BPAC_1" SIZE="1" >
 <LIN>
 <FLD NAME="CODADR" TYPE="Char" >CORP</FLD>
 <FLD NAME="POSCOD" TYPE="Char" >30096</FLD>
 <FLD NAME="CTY" TYPE="Char" >DULUTH</FLD>
 <FLD MENULAB="Yes" MENULOCAL="1" NAME="BPAADDFLG" TYPE="Integer" >2</FLD>
 </LIN>
 <LIN>
 <FLD NAME="CODADR" TYPE="Char" >CORP1</FLD>
 <FLD NAME="POSCOD" TYPE="Char" >30096</FLD>
 <FLD NAME="CTY" TYPE="Char" >DULUTH</FLD>
 <FLD MENULAB="Yes" MENULOCAL="1" NAME="BPAADDFLG" TYPE="Integer" >1</FLD>
 </LIN>
 </TAB>
 <GRP ID="BPC3_2" >
 <FLD NAME="VACBPR" TYPE="Char" >NTX</FLD>
 </GRP>
 <TAB DIM="30" ID="BPC4_1" SIZE="1">
 <LIN>
 <FLD NAME="BPAADD" TYPE="Char">CORP</FLD>
 <FLD MENULAB="No" MENULOCAL="1" NAME="BPDADDFLG" TYPE="Integer">2</FLD>
 </LIN>

 </TAB>
 </PARAM>]]>
</objectXml>
      </wss:save>
   </soapenv:Body>
</soapenv:Envelope>

 

 

JSON format

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wss="http://www.adonix.com/WSS">
   <soapenv:Header/>
   <soapenv:Body>
      <wss:save soapenv:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/">
         <callContext xsi:type="wss:CAdxCallContext">
            <codeLang xsi:type="xsd:string">ENG</codeLang>
            <poolAlias xsi:type="xsd:string">V11P0</poolAlias>
            <poolId xsi:type="xsd:string"></poolId>
            <requestConfig xsi:type="xsd:string"></requestConfig>
         </callContext>
         <publicName xsi:type="xsd:string">BPC</publicName>
         <objectXml xsi:type="xsd:string">
 {
 "BPC0_1":{"BCGCOD":"US","BPCNUM":"NA325"},
 "BPRC_1":{"BPRNAM":"JSON"},
 "BPAC_1":
 [
 {"CODADR":"CORP","POSCOD":"30096","CTY":"DULUTH","BPAADDFLG":2},
 {"CODADR":"CORP1","POSCOD":"30096","CTY":"DULUTH","BPAADDFLG":1},
 {"CODADR":"CORP2","POSCOD":"30096","CTY":"DULUTH","BPAADDFLG":1}
 ],
 "BPC3_2":{"VACBPR":"NTX"},
 "BPC4_1":
 [
 {"BPAADD":"CORP","BPDADDFLG":2},
 {"BPAADD":"CORP1","BPDADDFLG":1}
 ]
 }
</objectXml>
      </wss:save>
   </soapenv:Body>
</soapenv:Envelope>

Useful Knowledgebase (KB) articles:

KB ID 79703 : How to read a record

KB ID 79937: How to query a record

KB ID 80550: How to modify a record

KB ID 80551: How to save and create a record

KB ID 80552: How to delete a record

KB ID 80553: How to run a subprogram

KB ID 80554: How to retrieve the web service description (XML view)

KB ID 80555: How to retrieve the web service schema (XSD view)