如何在 SoapUI 工具的 SOAP 请求中指定复杂数据类型输入
我需要一些使用 SoapUI 工具的帮助。
我正在使用此工具测试 webServices API。
有一个名为 "getUsageReport()" 的 API,它采用 2 个
- 类型为
的输入参数
。 akaaurdt:ArrayOfString> <开始日期>
类型
定义如下。
<complexType name="ArrayOfString">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]" />
</restriction>
</complexContent>
</complexType>
当我通过在请求中提供日期来单击“运行”时, soap UI 中的请求 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:bil="https://control.akamai.com/BillingReports.xsd" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<soapenv:Header/>
<soapenv:Body>
<bil:getUsageReport soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<datasources xsi:type="bil:ArrayOfString" soapenc:arrayType="xsd:string[]"/>
<startDate xsi:type="xsd:string">?</startDate>
</bil:getUsageReport>
</soapenv:Body>
</soapenv:Envelope>
,这是响应
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server.generalException</faultcode>
<faultstring>akaaurdt:ApplicationError:ApplicationError:(?? No Data for Given Start Date. Please resubmit with a more recent date)</faultstring>
<detail>
<ns1:exceptionName xmlns:ns1="http://xml.apache.org/axis/">com.akamai.aws.util.AWSFault</ns1:exceptionName>
<ns2:hostname xmlns:ns2="http://xml.apache.org/axis/">qa-portal-ws01.qaextranet.akamai.com</ns2:hostname>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
如何在此请求 xml 中指定
参数来获取想要的回应?
请帮我解决这个问题
-Kiran
I need some help using the SoapUI tool.
I'm testing webServices APIs using this tool.
There is an API called "getUsageReport()" which takes 2 input parameters
<datasources>
of type<akaaurdt:ArrayOfString>
<start date>
of type<xsd:string>
<akaaurdt:ArrayOfString>
is defined as below.
<complexType name="ArrayOfString">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]" />
</restriction>
</complexContent>
</complexType>
the request xml in soap UI is as below
<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:bil="https://control.akamai.com/BillingReports.xsd" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<soapenv:Header/>
<soapenv:Body>
<bil:getUsageReport soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<datasources xsi:type="bil:ArrayOfString" soapenc:arrayType="xsd:string[]"/>
<startDate xsi:type="xsd:string">?</startDate>
</bil:getUsageReport>
</soapenv:Body>
</soapenv:Envelope>
when I click on RUN by giving a date in the request, this is the response
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server.generalException</faultcode>
<faultstring>akaaurdt:ApplicationError:ApplicationError:(?? No Data for Given Start Date. Please resubmit with a more recent date)</faultstring>
<detail>
<ns1:exceptionName xmlns:ns1="http://xml.apache.org/axis/">com.akamai.aws.util.AWSFault</ns1:exceptionName>
<ns2:hostname xmlns:ns2="http://xml.apache.org/axis/">qa-portal-ws01.qaextranet.akamai.com</ns2:hostname>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
How do I specify the <datasources>
parameter in this request xml to get the desired response?
Please help me with this
-Kiran
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
指定所需的日期
您应该在请求中
,日期格式我不知道它是如何定义的,因为它是字符串类型,而不是日期类型。尝试使用
yyyy/MM/dd
,是日期格式类型。you should specify the date
it's required in the request, the date format i don't know how it is defined, because it's string type, and not the date type.
Try with
yyyy/MM/dd
, is the date format type.您永远不想用 ? 提交请求占位符。编辑请求,以便有实际数据。
You never want to submit a request with ? placeholders. Edit the request so there's actual data.