如何在 SoapUI 工具的 SOAP 请求中指定复杂数据类型输入

发布于 2024-12-16 01:16:53 字数 2579 浏览 0 评论 0原文

我需要一些使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

凝望流年 2024-12-23 01:16:53
  1. 运行 BillingReports 的 getReports(或 getReportingGroups)。假设它返回一个名为 55555 的contractCode。
  2. 运行 getUsageReport 方法,它应该如下所示:
<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[]">
        <datasource xsi:type="xsd:string">55555</datasource>
    </datasources>
         <startDate xsi:type="xsd:string">20120620</startDate>
      </bil:getUsageReport>
   </soapenv:Body>
</soapenv:Envelope>
  1. Run getReports (or getReportingGroups) of the BillingReports. Lets say it returns a contractCode called 55555.
  2. Run method getUsageReport and it should look like the following:
<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[]">
        <datasource xsi:type="xsd:string">55555</datasource>
    </datasources>
         <startDate xsi:type="xsd:string">20120620</startDate>
      </bil:getUsageReport>
   </soapenv:Body>
</soapenv:Envelope>
辞慾 2024-12-23 01:16:53

指定所需的日期

<startDate xsi:type="xsd:string">?</startDate>

您应该在请求中

,日期格式我不知道它是如何定义的,因为它是字符串类型,而不是日期类型。尝试使用yyyy/MM/dd,是日期格式类型。

you should specify the date

<startDate xsi:type="xsd:string">?</startDate>

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.

高冷爸爸 2024-12-23 01:16:53

您永远不想用 ? 提交请求占位符。编辑请求,以便有实际数据。

You never want to submit a request with ? placeholders. Edit the request so there's actual data.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文