[KB 80553功能解说] 我该如何使用经典版SOAP Web services功能运行一个子程序?
* 本文由赛捷软件(上海)有限公司翻译完成,未经授权不得转载。如需转载,请先联系相应版块的版主取得授权。
产品
Sage EM企业管理(原名Sage X3)
类别
配置
设置与偏好
描述
我该如何使用经典版SOAP Web services功能运行一个子程序?
自PU9开始,web services是通过管理→管理→Web Services→经典版SOAP Web services(soapGenerics)功能管理的。
解决方法
1. 请确认经典版SOAP Web services配置好了。请参见相关资源。
2. 点击功能:管理→管理→Web Services→经典版SOAP Web services(soapGenerics)。
3. 点击“CAdxWebServicXmlCC”链接。
4. 点击STUB版块中的显示卡箭头展开操作。
5. 点击“run”(运行X3子程序)。
6. 录入一个语言,例如ENG。
7. 录入在经典版SOAP池配置(soapClassicPools)功能中设定的池别名。
8. 请注意:【池ID】和【请求的配置】不是必填的。至于和有关请求的配置的更多选项,请查看在线帮助主题“SOAP Web services实施” 。
9. 录入与在开发→脚本字典→脚本→Web服务(GESAWE)功能中的发布名称相同的【公用名称】(例如ZSUBADD。
10. 为【输入XML / JSON】录入值。
11. 点击“调用”。
在像SOAPUI这样的外部程序中,语法类似于:
请注意:你必须使用Syracuse web service凭据进行基本身份验证设置
XML格式
<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:run 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">adxwss.beautify=true</requestConfig>
</callContext>
<publicName xsi:type="xsd:string">ZSUBADD</publicName>
<inputXml xsi:type="xsd:string">
<![CDATA[<PARAM>
<FLD NAM="X" >1.1</FLD>
<FLD NAM="Y" >.99</FLD>
</PARAM>]]>
</inputXml>
</wss:run>
</soapenv:Body>
</soapenv:Envelope>
JSON格式
<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:run 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">adxwss.beautify=true</requestConfig>
</callContext>
<publicName xsi:type="xsd:string">ZSUBADD</publicName>
<inputXml xsi:type="xsd:string">
{
"GRP1":{"X":"1.1","Y":".99"}
}
</inputXml>
</wss:run>
</soapenv:Body>
</soapenv:Envelope>
相关资源
在Sage X3 PU9和之后版本中我该如何配置和测试SOAP web services?
补充信息
上面的示例使用的是一个简单的子程序。仅限测试和演示目的,这些是能够使用上述示例的步骤。
1. 前往功能:开发→脚本字典→脚本→脚本编辑器(GESADC)。
2. 录入一个名为ZSUBADD的文件名。
3. 复制并粘贴:
Subprog ZSUBADD(X, Y, Z)
Variable Decimal X
Variable Decimal Y
Variable Decimal Z
Z=X+Y
End
4. 创建子程序并发布。
5. 前往功能:开发→脚本字典→脚本→子程序(GESASU)。
6. 点击 “新建”。
7. 录入ZSUBADD ,并点击放大镜。
8. 勾选【Web services】复选框。
9. 点击 “创建”。
10. 点击 “发布”。
11. 录入ZSUBADD,点击“创建”并确认。
12. 点击 “发布”。
13. 点击 “退出功能”。 |