如何使用TCLWS包传递嵌套的soap请求参数?

时间:2013-06-03 08:05:49

标签: tcl tclws

这是我想要的样本请求,以获得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?

0 个答案:

没有答案