赛捷软件论坛's Archiver

lynn.yu 发表于 2019-12-12 11:31

[KB 80553功能解说] 我该如何使用经典版SOAP Web services功能运行一个子程序?

[b]* 本文由赛捷软件(上海)有限公司翻译完成,未经授权不得转载。如需转载,请先联系相应版块的版主取得授权。[/b]



[b]产品[/b]
Sage EM企业管理(原名Sage X3)


[b]类别[/b]
配置
设置与偏好



[b]描述[/b]
我该如何使用经典版SOAP Web services功能运行一个子程序?

自PU9开始,web services是通过[b]管理→管理→Web Services→经典版SOAP Web services[/b](soapGenerics)功能管理的。


[b]解决方法[/b]
1.        请确认经典版SOAP Web services配置好了。请参见相关资源。
2.        点击功能:[b]管理→管理→Web Services→经典版SOAP Web services[/b](soapGenerics)。
3.        点击[b]“CAdxWebServicXmlCC”[/b]链接。
4.        点击[b]STUB[/b]版块中的[b]显示卡[/b]箭头展开[b]操作[/b]。
5.        点击[b]“run”[/b](运行X3子程序)。
6.        录入一个语言,例如[b]ENG[/b]。
7.        录入在[b]经典版SOAP池配置[/b](soapClassicPools)功能中设定的[b]池别名[/b]。
8.        [b]请注意:[/b][b]【池ID】[/b]和[b]【请求的配置】[/b]不是必填的。至于和有关[b]请求的配置[/b]的更多选项,请查看在线帮助主题“SOAP Web services实施” 。
9.        录入与在[b]开发→脚本字典→脚本→Web服务[/b](GESAWE)功能中的发布名称相同的[b]【公用名称】[/b](例如ZSUBADD。
10.        为[b]【输入XML / JSON】[/b]录入值。
11.        点击[b]“调用”[/b]。

在像SOAPUI这样的外部程序中,语法类似于:

[b]请注意:[/b]你必须使用Syracuse web service凭据进行基本身份验证设置

[b][u]XML格式[/u][/b]
<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>

[b][u]JSON格式[/u][/b]
<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>


[b]相关资源[/b]
在Sage X3 PU9和之后版本中我该如何配置和测试SOAP web services?


[b]补充信息[/b]
上面的示例使用的是一个简单的子程序。仅限测试和演示目的,这些是能够使用上述示例的步骤。

1.        前往功能:[b]开发→脚本字典→脚本→脚本编辑器[/b](GESADC)。
2.        录入一个名为ZSUBADD的文件名。
3.        复制并粘贴:
[b]Subprog ZSUBADD(X, Y, Z)
Variable Decimal X
Variable Decimal Y
Variable Decimal Z
Z=X+Y
End[/b]
4.        创建子程序并发布。
5.        前往功能:[b]开发→脚本字典→脚本→子程序[/b](GESASU)。
6.        点击 [b]“新建”[/b]。
7.        录[b]入ZSUBADD[/b] ,并点击放大镜。
8.        勾选[b]【Web services】[/b]复选框。
9.        点击[b] “创建”[/b]。
10.        点击 [b]“发布”[/b]。
11.        录入[b]ZSUBADD[/b],点击[b]“创建”[/b]并确认。
12.        点击[b] “发布”[/b]。
13.        点击 [b]“退出功能”[/b]。

页: [1]

Powered by Discuz! Archiver 7.2  © 2001-2009 Comsenz Inc.