2

这是我想提出的示例请求,以从 TABLE1 和 TABLE2 中获取匹配结果

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:my:functions">
   <soapenv:Header/>
   <soapenv:Body>
      <urn:MY_TABLES>
         <!--You may enter the following 50 items in any order-->
         <TABLE1>
            <!--Zero or more repetitions:-->
            <item>
               <!--Optional:-->
               <FIELD1>%</FIELD1>
            </item>
         </TABLE1>

         <TABLE2>
            <!--Zero or more repetitions:-->
            <item>
               <!--Optional:-->
               <FIELD1>%</FIELD1>
            </item>
         </TABLE2>

         <TABLE1_FLAG>Y</TABLE1_FLAG>
         <TABLE2_FLAG>Y</TABLE2_FLAG>
      </urn:MY_TABLES>
   </soapenv:Body>
</soapenv:Envelope>

我正在尝试使用 TCLWS 包使用以下 TCL 代码模拟此 SOAP GUI 请求

package require WS::Client
package require WS::Utils

set wsdlInfo [::WS::Client::GetAndParseWsdl "https://mytablesurl.com"]
# The parsing happens successfully

# But making a request as below throws me errors
set argList {TABLE1 {item {FIELD1 %}} TABLE1_FLAG Y TABLE2 {item {FIELD1 %}} TABLE2_FLAG Y}
puts [::WS::Client::DoCall MY_TABLESService MY_TABLES $argList]

抛出错误

can't read "simpleTypes(Client,Z_OSS_RFC_TABLESService,TABLE1)": no such element in array
    while executing
"set xns $simpleTypes($mode,$service,$typeName)"
    (procedure "convertDictToType" line 30)
    invoked from within
"convertDictToType $mode $service $doc $retNode $resultValue $itemType"
    (procedure "::WS::Utils::convertDictToType" line 196)
    invoked from within
"::WS::Utils::convertDictToType Client $serviceName $doc $reply $argList $xns:$msgType $forceNs"
    (procedure "buildDocLiteralCallquery" line 81)
    invoked from within
"buildDocLiteralCallquery $serviceName $operationName $url $argList"
    (procedure "buildCallquery" line 16)
    invoked from within
"buildCallquery $serviceName $operationName $url $argList"
    invoked from within
"::WS::Client::DoCall MY_TABLESService MY_TABLES $argList"
    invoked from within

如何将这些参数传递给 ::WS::Client::DoCall?

4

0 回答 0