所以我有两个系统(ARCHIBUS和MAXIMO),我需要在它们之间同步一些数据。系统#1(ARCHIBUS)有一个"转移表"该数据正从其他表的触发器转储。每天晚上,我需要在System#1的转移表中获取行,并对System#2(MAXIMO)进行Web服务调用。这是转移表的简化版本:
ACTION APPROVED BUILDINGID FLOORID ROOMID DESCRIPTION TRANSFERDATE
INSERT 1 7000 New Engineering Building
INSERT 1 7000 1 1st Floor
UPDATE 1 6808 Old Engineering Building
DELETE 1 5401
UPDATE 0 2387 3 326 Joe's Office
UPDATE 1 3491 2 219 Bob's Office
如果我们查看表格,我们会看到有3种不同的"操作":INSERT,UPDATE和DELETE。如果操作是INSERT,那么我们需要发送一个带有如下正文消息的POST:
网络服务网址:
http://maximoserver:9080/meaweb/services/LOCATIONSYNC
消息:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:max="http://www.ibm.com/maximo">
<soap:Header/>
<soap:Body>
<max:CreateLOCATIONSYNC>
<max:LOCATIONSYNCSet>
<max:LOCATIONS action="Add">
<max:DESCRIPTION>New Engineering Building</max:DESCRIPTION>
<max:HIERARCHYPATH>7000</max:HIERARCHYPATH>
<max:LOCATION>7000</max:LOCATION>
<max:PARENT></max:PARENT>
<max:STATUS>OPERATING</max:STATUS>
</max:LOCATIONS>
</max:LOCATIONSYNCSet>
</max:CreateLOCATIONSYNC>
</soap:Body>
</soap:Envelope>
对于UPDATE操作,消息如下:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:max="http://www.ibm.com/maximo">
<soap:Header/>
<soap:Body>
<max:UpdateLOCATIONSYNC>
<max:LOCATIONSYNCSet>
<max:LOCATIONS action="Change">
<max:DESCRIPTION>Old Engineering Building</max:DESCRIPTION>
<max:LOCATION>6808</max:LOCATION>
</max:LOCATIONS>
</max:LOCATIONSYNCSet>
</max:UpdateLOCATIONSYNC>
</soap:Body>
</soap:Envelope>
最后,对于DELETE操作,消息将是:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:max="http://www.ibm.com/maximo">
<soap:Header/>
<soap:Body>
<max:UpdateLOCATIONSYNC>
<max:LOCATIONSYNCSet>
<max:LOCATIONS action="Change">
<max:LOCATION>5401</max:LOCATION>
<max:STATUS>DECOMMISSIONED</max:STATUS>
</max:LOCATIONS>
</max:LOCATIONSYNCSet>
</max:UpdateLOCATIONSYNC>
</soap:Body>
</soap:Envelope>
发送消息后,如果是HTTP&#34; 200&#34;收到响应后,应将TRANSFERDATE字段设置为当前日期/时间戳。如果它获得除200成功消息之外的任何其他内容,则应将TRANSFERDATE设置为null。
我的想法是,必须使用FOR EACH循环来为每行创建一条消息并获得响应并更新TRANSFERDATE字段。任何人都可以确认这一点或提供其他方法来做到这一点?还有我应该注意的任何问题吗?