新一代平台已弃用

IBM Sterling Order Management 系统商店库存管理微服务集成

注意: 若要从 IBM®Sterling Order Management 系统调用 Store库存管理 REST API,请使用 REST API集成作为服务定义框架。 此方法是与 “商店库存管理 ”REST 服务进行集成的推荐且受支持的方法。

使用 SIMInvokeRestAPI 服务从 Sterling Order Management 系统调用商店库存管理 REST API。

以下示例输入说明了使用 SIMInvokeRestAPI 服务发出的 GET 请求。
<SIMApi HTTPMethod="GET" URL="/stores/Mtrx_Store_1/locations/BackShelf-5">
    <RequestHeaders>
        <Header Name="Accept" Value="application/json"/>
        <Header Name="Content-Type" Value="application/json"/>
    </RequestHeaders>
<Template>
<Location></Location>
</Template>
</SIMApi>
 

此处, HTTPMethod 属性可以是有效的 HTTP 方法,例如 GET , POST , PUT , DELETE 和 PATCH。 URL是REST API的URL。 例如,如果 HTTP完整 URL 是 https://<host-ip>:8080/<tenant-id>/v1/stores/Node1/locations/BackShelf-5 ,则URL 是 /stores/Node1/locations/BackShelf-5 。 要设置所有请求头,请使用 RequestHeaders 元素,如 样本输入中所示。 当使用 HTTP POST、PUT、DELETE和PATCH时,您可以使用 RequestBody 元素将请求正文作为输入的一部分发送。 有关 RequestBody 元素的更多信息,请参阅 样本输入。 使用 Template 元素来指定 SIMInvokeRestAPI 服务的根元素名称。 如果未定义模板,那么会在输出 XML 中插入缺省 <Entity> 根元素。

Draft comment: shailaskumar@in.ibm.com

The Store Inventory Management APIs generates a JSON output. The SIMInvokeRestAPI service converts the JSON into an XML file. To force data conversion, use the /resources/jsonXPathTransformations.xml file.

下面是输出示例:
<Location 
   aisle="" 
   bay="" 
   bin="false" 
   depth="" 
   height="" 
   id="a91c7099-4dc8-4195-91f6-e33a132c0c3a" 
   length="" 
   locationId="BackShelf-5" 
   name="" 
   parentLocationId="" 
   physicalSpaceIdentifier="" 
   sequence="0" 
   storeId="Mtrx_Store_1" 
   tenantId="Matrix-R" 
   type="STOCKROOM" 
   virtual="false" 
   weightLimit="" 
   zone=""
/>
Draft comment: shailaskumar@in.ibm.com
If you want to transform the JSON output of the REST API to a particular XPath in the output, define the jsonXPathTransformations.xml file and copy the file to the class path in /resources/jsonXPathTransformations.xml file.
以下示例输入说明了添加位置的 POST 请求:
<SIMApi HTTPMethod="POST" URL="/stores/Node1/locations">
    <RequestBody>
        <Location length="122" locationId="DockYYNew" name="new11" parentLocationId="" physicalSpaceIdentifier="" sequence="0" storeId="Store1" tenantId="T1" type="STOCKROOM" virtual="false" weightLimit="" zone="Z1"/>
    </RequestBody>
    <RequestHeaders>
        <Header Name="Accept" Value="application/json"/>
        <Header Name="Content-Type" Value="application/json"/>
    </RequestHeaders>
    <Template>
        <Location></Location>
    </Template>
</SIMApi>
下面的输入示例说明了修改位置的 PUT 请求:
<SIMApi HTTPMethod="PUT" URL="/stores/Store1/locations/StoreDock01">
    <RequestBody>
        <Location length="122" locationId="StoreDock01" name="new11" parentLocationId="" physicalSpaceIdentifier="" sequence="0" storeId="Node1" tenantId="Nisha" type="STOCKROOM" virtual="false" weightLimit="" zone="Z1"/>
    </RequestBody>
    <RequestHeaders>
        <Header Name="Accept" Value="application/json"/>
        <Header Name="Content-Type" Value="application/json"/>
    </RequestHeaders>
    <Template>
        <Location></Location>
    </Template>
</SIMApi>
下面的输入示例说明了调整某个地点库存的 POST 请求:
<SIMApi HTTPMethod="POST" URL="/stores/Node1/locations/StoreDock01/inventory:add">
    <RequestBody>
        <product productId="202" unitOfMeasure="EACH" addQuantity="500" inventoryStatus="GOOD"/>
    </RequestBody>
    <RequestHeaders>
        <Header Name="Accept" Value="application/json"/>
        <Header Name="Content-Type" Value="application/json"/>
    
    </RequestHeaders>
<Template>
<product></product>
</Template>
</SIMApi>