我正在尝试将 SOAP api 与 SOAPUI 一起使用。WSDL 中描述的“get”操作如下所示:
<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:urn="urn:MarketingCenter" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<soapenv:Header/>
<soapenv:Body>
<urn:Get soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<Authentication xsi:type="urn:Authentication">
<!--You may enter the following 6 items in any order-->
<Username xsi:type="xsd:string">myUserName</Username>
<Password xsi:type="xsd:string">mypassword</Password>
<CustomerId xsi:type="xsd:int">29833</CustomerId>
<Level xsi:type="xsd:int">0</Level>
<Source xsi:type="xsd:string">?</Source>
<Options xsi:type="xsd:int">0</Options>
</Authentication>
<Method xsi:type="xsd:string">keyword.list</Method>
<Arguments xsi:type="urn:ArrayOfKeyValuePairs" soapenc:arrayType="urn:KeyValuePair[]"/>
</urn:Get>
</soapenv:Body>
</soapenv:Envelope>
但是,当我运行此操作时,会出现以下错误:
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns4="urn:MarketingCenter">
<SOAP-ENV:Body>
<ns4:GetResponse>
<return xsi:type="ns4:GetResponseData">
<Data xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:anyType[0]" xsi:nil="true"/>
<Status>
<ErrorCode xsi:type="xsd:int">1</ErrorCode>
<ErrorString xsi:type="xsd:string">One or more of the arguments were invalid</ErrorString>
<ErrorDetails xsi:type="xsd:string">One or more of the arguments were invalid</ErrorDetails>
</Status>
</return>
</ns4:GetResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
我不确定我应该在哪里,但参数列表,或者如何格式化这个列表。我确实意识到他们想要一个参数数组,但是我应该把这个数组放在哪里?无论我应该在哪里输入其他值,都会有一个“?”,所以我不确定在哪里输入这个 argumentw 数组。